import request from "@/utils/request";
interface LoginParamsModel {
    username: string,
    password: string
}
export interface MemberModel{
    title:string,
    price:number,
    total_price:number,
}
export type  MemberListModel =MemberModel[]

export default  {
    //登录
    login(loginParams: LoginParamsModel) {
        return request.post('http://gmall-h5-api.atguigu.cn/app-dev/admin/acl/index/login',loginParams);
    },
    //退出登录
    logout() {
        return request.post('http://gmall-h5-api.atguigu.cn/app-dev/admin/acl/index/logout')
    },
    //获取用户信息
    getUserInfo (token='5858c60a-7a7c-4593-869e-3019e126c4f2',use='update'){
        return request.get(`/userCenter/users/me?access_token=${token}&use=${use}`)
    },
    //获取会员信息
    getMemberInfo(token='5858c60a-7a7c-4593-869e-3019e126c4f2',groupType='vip_product'){
        // return request.get<any,MemberModel>(`/setup/setups/search/findByGroupType?access_token=${token}&groupType=${groupType}`)
        return request.get(`/setup/setups/search/findByGroupType?access_token=${token}&groupType=${groupType}`)
    }
}

